package dome1;

public class Text {
    public static void main(String[] args) {
        Dog dog = new Dog("小黑",5);
        System.out.println(dog.name);
        System.out.println(dog.age);
        dog.eat(); //访问子类自己的eat()方法
        dog.sleep();//访问父类的sleep()方法
        dog.bark();//访问子类自己的bark()方法
    }
}
